﻿@using WebApp.Extensions
@model Dto.ApiResponses.TemplateResponses.TemplateResponse
@{
    ViewBag.CurrentPage = WebApp.Common.PageSetting.TemplateEditPageSetting;
    var sectionId = (Request.IsAjaxRequest() ? "Ajax" : "View") + "_Template_Edit" + Model.Id;
}

@section Scripts{
    <script type="text/javascript">
        require(['Template/Edit', 'Util'], function (api, util) {
            var model = util.toJS(@(Html.ToJson(Model)));
            $(function () { api.exec('@sectionId', model); });
        });
    </script>
}

<div class="container" data-bind="stopbinding: true">
    <section id="@sectionId">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="name">Name</label>
                            <input type="text" id="name" class="form-control " data-bind="value : name" required />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="value">Value</label>
                            <textarea id="value" class="form-control" rows="6" data-bind="value : value" required></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row  center">
            <button class="btn btn-primary btn-lg" data-bind="click:submit">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;
            <button class="btn btn-primary btn-lg" data-bind="click:cancel">Cancel</button>
        </div>
    </section>
</div>
